package com.example.firstapp;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

public class TestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);

        //绑定组件
        Button test01 = findViewById(R.id.bt_test01);
        Button test02 = findViewById(R.id.bt_test02);
        Button test03 = findViewById(R.id.bt_test03);
        Button test03Bak = findViewById(R.id.bt_test03Bak);
        Button test04 = findViewById(R.id.bt_test04);
        Button test05 = findViewById(R.id.bt_test05);
        Button music01 = findViewById(R.id.bt_music01);

        /*
         * 监听组件
         * 用匿名监听组件
         */
        //第一次作业按钮监听
        test01.setOnClickListener(view -> {
            Intent intent = new Intent(this, Test01Activity.class);
            startActivity(intent);
        });

        //第二次作业按钮监听
        test02.setOnClickListener(view -> {
            Intent intent = new Intent(this, Test02Activity.class);
            startActivity(intent);
        });

        //第三次作业按钮监听
        test03.setOnClickListener(view -> {
            Intent intent = new Intent(this, Test03Activity.class);
            startActivity(intent);
        });

        //第三次作业备份按钮监听
        test03Bak.setOnClickListener(view -> {
            Intent intent = new Intent(this, Test03BakActivity.class);
            startActivity(intent);
        });

        //第四次作业按钮监听
        test04.setOnClickListener(view -> {
            Intent intent = new Intent(this, Test04Activity.class);
            startActivity(intent);
        });

        //第五次作业按钮监听
        test05.setOnClickListener(view -> {
            Intent intent = new Intent(this, Test05_1Activity.class);
            startActivity(intent);
        });

        //音乐按钮监听
        music01.setOnClickListener(view -> {
            Intent intent = new Intent(this, Music01Activity.class);
            startActivity(intent);
        });
    }

}